import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from "../pages/home.vue"
// import About from "../pages/about.vue"
Vue.use(VueRouter)

const fileNames = require.context('../../src/pages/', true, /\.vue$/)
console.log(fileNames.keys(), '999')

const router = new VueRouter({
    routes: [
        { path: '/', component: ()=> import("../pages/home.vue") },
        { path: '/about', component: () => import("../pages/about.vue")  }
    ] 
})
router.beforeEach((to, from, next)=>{
   console.log(to,'to')
    console.log(from,'from')
    next()
})

export default router